package com.padakeji.android.ui.examples;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;

import com.padakeji.android.ui.widget.IconEditText;

/**
 * Created by atanl on 2015/10/21.
 */
public class IconEditTextTestActivity extends Activity {

    // Various.
    private int counter = 0;

    // Views.
    private EditText normalEdit;
    private IconEditText customizeEdit;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_icon_edit_text_test);

        findViews();
        configViews();

    }

    private void findViews() {
        normalEdit = (EditText) findViewById(R.id.activity_IconEditTextTest_text_normal);
        customizeEdit = (IconEditText) findViewById(R.id.activity_IconEditTextTest_IconEditText_customize);
    }

    private void configViews() {
        normalEdit.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Toast.makeText(IconEditTextTestActivity.this, "" + counter++, Toast.LENGTH_SHORT).show();
            }
        });

        customizeEdit.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Toast.makeText(IconEditTextTestActivity.this, "" + counter++, Toast.LENGTH_SHORT).show();
            }
        });
    }
}
